﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tracy.DataModel.UltraExplorer;
using Tracy.DataModel;

namespace Tracy.Plugins.Classifiers.FileClassifiers
{
    public class EntryFileClassifier : AbstractClassifier<MediaFile>
    {
        protected override List<string> GetCategories(MediaFile file)
        {
            List<string> rtn = new List<string>();
            if (file != null && file.Resource != null && file.Resource.Entry != null)
            {
                rtn.Add(file.Resource.Entry.ID);
            }
            return rtn;
        }

        public override string GetCategoryName(string key)
        {
            return TracyBus.Instance.EntryProvider.GetItemByID(key).Name;
        }

        public override bool MatchCategory(MediaFile item, string key)
        {
            if (item != null && item.Resource != null && item.Resource.Entry != null)
            {
                return item.Resource.Entry.ID == key;
            }
            return false;
        }
    }


}
